<?php
class Zend_View_Helper_ShowCategoryIndex {
    public function showCategoryIndex($view) {

    	$category = $view->Category;
    	$str='';
        $str .= '<table id="product-table" border="0" cellpadding="0" cellspacing="0" width="100%">';
		$str .= '<tr>';
    	$str .= '<th class="table-header-repeat line-left minwidth-1"><a href="">Id</a></th>';
    	$str .= '<th class="table-header-repeat line-left minwidth-1"><a href="">Tên</a></th>';
    	$str .= '<th class="table-header-repeat line-left minwidth-1"><a href="">Slug</a></th>';
    	$str .= '<th class="table-header-repeat line-left minwidth-1"><a href="">Ngôn Ngữ</a></th>';
    	$str .= '<th class="table-header-repeat line-left minwidth-2"><a href="">Thao Tác</a></th>';
		$str .= '</tr>';
		
		foreach ($category as $category) {
        	$str .= '<tr>'; 	
            $str .='<td>'.$category->category_id.'</td>';
            $str .='<td>'.$category->name.'</td>';
            $str .='<td>'.$category->slug.'</td>';
            $str .='<td>'.$category->language.'</td>';
            $str .= '<td class="options-width">';
            $str .= '<a title="Sửa" class="icon-1 info-tooltip" href="'.$view->url(array('controller'=>'category', 'action'=>'edit', 'category_id'=>$category->category_id)).'"></a> ';
            $str .= '<a title="Thêm" class="icon-3 info-tooltip" href="'.$view->url(array('controller'=>'category', 'action'=>'add','category_id'=>$category->category_id)).'"></a>';
            $str .= '<a title="Xóa" class="icon-2 info-tooltip" href="'.$view->url(array('controller'=>'category', 'action'=>'delete','category_id'=>$category->category_id)).'"></a></td>';
            $str .='</tr>';
        }
        
        $str .= '</table>';
        
        return $str; 

    }
}